#ifndef _FMVC_EXCEPTIONS_
#define _FMVC_EXCEPTIONS_

#include <sstream>
#include <exception>


namespace Storage
{
  class KeyNotFoundInDb : public std::exception {};
  class DbError : public std::exception {};
};

namespace Auth
{
  class BadLogin : public std::exception {};
  class WrongPassword : public std::exception {};
  class UserNotFound : public std::exception {};
  class BadRegister : public std::exception {};
  class WrongFormatUserPassword : public std::exception {};
  class UserExists : public std::exception {};
};

namespace FMVC
{
  class KeyNotFoundInQueryString : public std::exception
  {
    std::string _file;
    std::string _key;
    int _line;
    public:
    KeyNotFoundInQueryString(const std::string& file,int line,const std::string& key)
    {
      _file = file;
      _line = line;
      _key = key;
    };

    virtual const char* what() const throw()
    {
      std::ostringstream what;
      what << "File: " << _file << " Line: " << _line;

      return what.str().c_str();
    };

    std::string key() const throw()
    {
      return _key;
    };

    virtual ~KeyNotFoundInQueryString() throw() {};
  };
};
#endif
